import Vue from "vue";
import PatientForm from "../components/patient-form";
import "element-ui/lib/theme-chalk/index.css";
// import '../../../Resources/css/reset.css'
//兼容ie
import "babel-polyfill";
require("./module.js");
Vue.component(PatientForm.name, PatientForm);
if (MODEL == null && patient_id == null) {
	var INFO = {
		partientInfo: {}
	};
} else if (MODEL == null && patient_id != null) {
	var INFO = {
		partientInfo: {
			patient_id: patient_id
		}
	};
} else {
	var INFO = {
		partientInfo: {
			patient_id: MODEL.patientId,
			name: MODEL.patientName,
			age: MODEL.patientAge,
			mobile: MODEL.mobile,
			gender: MODEL.patientGender,
			province_id: MODEL.provinceId,
			city_id: MODEL.cityId,
			imaging_exam_no: MODEL.imagingExamNo,
			present_history: MODEL.presentHistory,
			doctor_advice: MODEL.doctorAdvice,
			cases: MODEL.caseName.split(","),
			address: MODEL.patientBirthplace,
			patientBirthday: MODEL.patientBirthday,
			case_id: MODEL.id,
			address_value: {
				selections: [],
				address: ""
			},
			supervisor_doctor_id: MODEL.supervisorDoctorId,
			creator_doctor_id: MODEL.creator_doctor_id,
			supervisor_doctor_name: MODEL.creatorDoctorName,
			creator_doctor_name: MODEL.supervisorDoctorName
		}
	};
}
INFO.action = action;
new Vue({
	el: "#patientForm",
	data: INFO,
	methods: {
		address: function() {
			if (MODEL != null) {
				this.partientInfo.address_value.selections[0] = this.partientInfo.province_id;
				this.partientInfo.address_value.selections[1] = this.partientInfo.city_id;
				this.partientInfo.address_value.address = this.partientInfo.address;
			}
		}
	},
	created() {
		this.address();
	}
});
